package com.koocloud.electroplatemanage.mapper;



import com.koocloud.electroplatemanage.pojo.ProductionPlan;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProductionPlanMapper {

    //根据id查看一条记录
    ProductionPlan selectById(String workOrderNumber);

    //根据工单号查看一条记录
    ProductionPlan selectByWorkOrderNumber(String workOrderNumber);

    //查询所有记录
    List<ProductionPlan> selectAllData(@Param("beginTime")String beginTime,@Param("endTime")String endTime,ProductionPlan productionPlan);
    //查询生产计划表记录数
    int selectCount();
    //查询生产计划表最大id
    int selectMaxId();
    //插入一条记录
    int insert(ProductionPlan productionPlan);
    //逻辑删除一条记录
    int delete(@Param("workOrderNumber")String workOrderNumber, @Param("deleteFlag") String deleteFlag);
    //加急
    int expedited(@Param("workOrderNumber")String workOrderNumber, @Param("deleteFlag") String deleteFlag);
    //取消加急
    int cancelDelete(@Param("workOrderNumber")String workOrderNumber, @Param("deleteFlag") String deleteFlag);
    //二次加急
    int mExpedited(@Param("workOrderNumber")String workOrderNumber, @Param("deleteFlag") String deleteFlag);
    //取消二次加急
    int cancelExpedited(@Param("workOrderNumber")String workOrderNumber, @Param("deleteFlag") String deleteFlag);
    //修改一条记录
    int update(ProductionPlan productionPlan);

    //查询生产计划表所有数据
    ProductionPlan selectByBatchAndOrderNum(@Param("orderNumber")String orderNumber, @Param("batchNumber")String batchNumber);
    /**
     * 根据生产计划id获取关联的主表id
     * @param workOrderNumber
     * @return
     */
    String selectIncomepartjudgeIdById(String workOrderNumber);

    /**
     * 将生产计划表标志修改为1
     * @param workOrderNumber
     * @param deleteFlag
     * @return
     */
    Integer updateFlag(String workOrderNumber, String deleteFlag);
    //根据工单号查询记录数
    int selectWorkOrderNumberCount(String workOrderNumber);
}
